package cn.iocoder.yudao.module.pickbook.dal.mysql.bookcontent;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.pickbook.dal.dataobject.bookcontent.BookContentDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.pickbook.controller.admin.bookcontent.vo.*;

/**
 * 绘本内容 Mapper
 *
 * @author 芋道源码
 */
@Mapper
public interface BookContentMapper extends BaseMapperX<BookContentDO> {

    default PageResult<BookContentDO> selectPage(BookContentPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<BookContentDO>()
                .eqIfPresent(BookContentDO::getBookId, reqVO.getBookId())
                .eqIfPresent(BookContentDO::getPages, reqVO.getPages())
                .eqIfPresent(BookContentDO::getCreator, reqVO.getCreator())
                .orderByDesc(BookContentDO::getId));
    }

}